//package sjd.ahsj.springbootmybatisplusoracle.config;
//
//import org.springframework.security.core.Authentication;
//import org.springframework.security.core.context.SecurityContextHolder;
//import org.springframework.web.filter.GenericFilterBean;
//import sjd.ahsj.springbootmybatisplusoracle.jwt.TokenAuthenticationService;
//
//import javax.servlet.FilterChain;
//import javax.servlet.ServletException;
//import javax.servlet.ServletRequest;
//import javax.servlet.ServletResponse;
//import javax.servlet.http.HttpServletRequest;
//import java.io.IOException;
//
///**
// * Created by Eastern unbeaten on 2018/4/1.
// */
//public class JWTAuthenticationFilter extends GenericFilterBean {
//    @Override
//    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
//        Authentication authentication = TokenAuthenticationService
//                .getAuthentication((HttpServletRequest) request);
//        //
//        SecurityContextHolder.getContext()
//                .setAuthentication(authentication);
//        chain.doFilter(request,response);
//
//    }
//}
